package com.dm.flyweight.demo02;

import java.util.List;
import java.util.ArrayList;

/**
 * UnSharedConcerteFlyweight
 * @author Administrator
 *
 */
public class OwnRow implements Glyph{
	
	List<OwnColumn> columns = new ArrayList<>();
	
	public void addColumn(OwnColumn column){
		this.columns.add(column);
	}

	@Override
	public void draw(GlyphContext context) {
		context.content.append("row: ");
		for (int i = 0; i < this.columns.size(); i++) {
			this.columns.get(i).draw(context);
		}
	}

	@Override
	public void intersects(String point, GlyphContext context) {
		context.add(this);
	}

}
